package com.example.mrwang.myviewgourp;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.Button;

import com.example.mrwang.ui.FlowLayout;
/**
 * @deprecated 已完成
 * */
public class MainActivity extends Activity {

    private FlowLayout fl;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        fl = (FlowLayout) findViewById(R.id.fl_layout);

        String[] str = new String[]{"One", "Two", "Three", "four", "five", "six", "fdfdaddf", "fdfeae", "fvfgffdsfa",
                "dasfefaefdaf", "Ondde", "dOne", "dfeasaggfgfaee", "sd", "fewadsfafafe", "fafdfafafafeadfa"};
        for (int i = 0; i < str.length; i++) {
            Button btn = new Button(this, null);
            btn.setLayoutParams(new ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT));
            btn.setText(str[i]);
            fl.addView(btn);
        }
    }
}
